package com.wingsfrog.travel.controller;

import com.wingsfrog.travel.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by rankin on 16/3/30.
 */
@RestController
@RequestMapping(value = "tasks")
public class TaskController {
    @Autowired
    TaskService taskService;

    @RequestMapping(value = "", method = {RequestMethod.GET})
    public Object getTaskList(HttpServletRequest request) {
        return taskService.getTaskList((Integer) request.getSession().getAttribute("userid"));
    }
}
